Socket
Socket
Sign inDemoInstall

@rollup/plugin-wasm

Package Overview
Dependencies
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rollup/plugin-wasm

Import WebAssembly code with Rollup


Version published
Weekly downloads
122K
increased by4.07%
Maintainers
4
Weekly downloads
 
Created

What is @rollup/plugin-wasm?

@rollup/plugin-wasm is a Rollup plugin that allows you to import WebAssembly (Wasm) modules. This plugin helps in bundling Wasm files with your JavaScript code, making it easier to work with WebAssembly in a Rollup-based build process.

What are @rollup/plugin-wasm's main functionalities?

Importing Wasm Modules

This feature allows you to import a Wasm module directly into your JavaScript code. The imported module can then be instantiated and used within your application.

import wasmModule from './module.wasm';

wasmModule().then(instance => {
  console.log(instance.exports);
});

Customizing Wasm Imports

This feature allows you to customize the way Wasm modules are imported. For example, you can specify certain modules to be imported synchronously.

import { defineConfig } from 'rollup';
import wasm from '@rollup/plugin-wasm';

export default defineConfig({
  input: 'src/main.js',
  output: {
    dir: 'output',
    format: 'esm'
  },
  plugins: [
    wasm({
      sync: ['module.wasm']
    })
  ]
});

Other packages similar to @rollup/plugin-wasm

Keywords

FAQs

Package last updated on 05 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc